<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>我的订单</title>

	<%-- 静态包含 base标签、css样式、jQuery文件 --%>
	<%@ include file="/pages/common/head.jsp"%>


	<style type="text/css">
	h1 {
		text-align: center;
		margin-top: 200px;
	}
</style>
</head>
<body>
	
	<div id="header">
			<span class="wel_word">我的订单</span>

		<%--静态包含，登录 成功之后的菜单 --%>
		<%@ include file="/pages/common/login_success_menu.jsp"%>
		<script type="text/javascript">
			$(function () {
				$("#change_status").click(function () {
					return confirm("你确定要完成收货?");
				})
			})
		</script>

	</div>
	
	<div id="main">
		
		<table>
			<tr>
				<td>日期</td>
				<td>金额</td>
				<td>状态</td>
				<td>详情</td>
			</tr>

			<c:if test="${empty requestScope.myorder}">
				<tr>
					<td colspan="4">亲,您还没有在该书城购物!</td>
				</tr>
			</c:if>
			<c:if test="${not empty requestScope.myorder}">
				<c:forEach items="${requestScope.myorder}" var="order">
					<tr>
						<td>${order.createTime}</td>
						<td>${order.price}</td>
						<td><c:if test="${order.status==0}">
							未发货
						</c:if>
							<c:if test="${order.status==1}">
								<a id="change_status" href="orderServlet?action=changeOrderStatus&orderid=${order.orderId}&status=${order.status}">已发货</a>
							</c:if>
							<c:if test="${order.status==2}">
								已收货
							</c:if>
						</td>
						<td><a href="orderServlet?action=queryOrderItems&orderid=${order.orderId}">查看详情</a></td>
					</tr>
				</c:forEach>
			</c:if>
		</table>
	</div>


	<%--静态包含页脚内容--%>
	<%@include file="/pages/common/footer.jsp"%>


</body>
</html>